/*    */ package com.kingdee.eas.lifetime.util.DButil;
/*    */ 
/*    */ import com.kingdee.bos.ui.face.CoreUIObject;
/*    */ import java.util.Map;
/*    */ import org.apache.log4j.Logger;
/*    */ 
/*    */ public class EDsqlResult
/*    */ {
/* 15 */   private static final Logger logger = CoreUIObject.getLogger(EDsqlResult.class);
/*    */   private StringBuffer sql;
/*    */   private static final String query_sign = "#";
/*    */ 
/*    */   public EDsqlResult(String sql)
/*    */   {
/* 20 */     this.sql = new StringBuffer(sql).append(" ");
/*    */   }
/*    */ 
/*    */   public void setCondition(Map queryMap)
/*    */   {
/* 29 */     if (queryMap == null) {
/* 30 */       return;
/*    */     }
/* 32 */     if (queryMap.isEmpty()) {
/* 33 */       return;
/*    */     }
/* 35 */     int start = this.sql.indexOf("#");
/* 36 */     while (start != -1) {
/* 37 */       int end = this.sql.indexOf("#", start + 1);
/* 38 */       String queryFiledName = this.sql.substring(start + 1, end);
/* 39 */       if (!queryMap.containsKey(queryFiledName)) {
/*    */       } else {
/* 42 */         this.sql.delete(start, end + 1);
/* 43 */         this.sql.insert(start, " '" + queryMap.get(queryFiledName) + "' ");
/*    */       }
/* 45 */       start = this.sql.indexOf("#");
/*    */     }
/*    */   }
/*    */ 
/*    */   public String getSqlValue()
/*    */   {
/* 52 */     return this.sql == null ? null : this.sql.toString();
/*    */   }
/*    */ 
/*    */   public String toString()
/*    */   {
/* 58 */     if (this.sql != null) {
/* 59 */       return this.sql.toString();
/*    */     }
/* 61 */     return super.toString();
/*    */   }
/*    */ }

/* Location:           D:\work\kingdee\enable\富国基金\fuguo_lib.jar
 * Qualified Name:     com.kingdee.eas.lifetime.util.DButil.EDsqlResult
 * JD-Core Version:    0.6.0
 */